<!-- 编辑新增对话框js,如有需要请导出到对应的对话框js文件中 -->
var yjshjDialog = function(){
  var modal = $('#yjshjDialog');
  var saveUrl = _CTX_ + _PATH_ + '/save';
  var form = modal.find("form");
  var _callback;
  _dictKit = _GetDictKit("shjlx","shjdj");


  $('.modal-dialog').css({
    'width': '70%',
    'height': '600px'
  });
  $('.control-label').css({
    'font-weight': 'normal'
  });

    var btnSave = modal.find("button[name='btnSave']");


  btnSave.click(function(){
    if (!SMValidator.validate('form')) {
      return false;
    }
    form.ajaxSubmit({
      url:saveUrl,
      type:"POST",
      dataType:"json",
      cache:false,
      success:function(ret){
        if(ret.state == "ok"){
          if(_callback && typeof(_callback)=='function'){
            result = _callback(ret);
            if(typeof(result) == 'undefined' || result != false){
              modal.modal('hide');
            }
          }
        }else{
          alert(ret.msg);
        }
      }
    });
  });


  return {
    show: function (entity, options) {
      if(options.title){
        modal.find(".modal-title").html(options.title);
      }
      if(options && options.callback){
        _callback = options.callback;
      }
      _FormKit_.bindData(form,entity,"entity",options.readOnly);

        modal.modal('show');
    }
  }

}();

// columnDefs: [{
//   'targets': 4,
//   'data': "id",
//   'class': "center",
//   'render': function (data, type, full, meta) {
//     return '<div class="hidden-sm hidden-xs action-buttons">'
//         + '<a class="green" href="javascript:modifyData(\'' + data + '\')">'
//         + '<i class="ace-icon fa fa-pencil bigger-130"></i>'
//         + '</a>'
//         + '<a class="red" href="javascript:deleteData(\'' + data + '\')">'
//         + '<i class="ace-icon fa fa-trash-o bigger-130"></i>'
//         + '</a>'
//         + '</div>'
//         + '<div class="hidden-md hidden-lg">'
//         + '<div class="inline position-relative">'
//         + '<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown" data-position="auto">'
//         + '<i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>'
//         + '</button>'
//         + '<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">'
//         + '<li>'
//         + '<a class="green" href="javascript:modifyData(\'' + data + '\')">'
//         + '<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>'
//         + '</a>'
//         + '</li>'
//         + '<li>'
//         + '<a class="red" href="javascript:deleteData(\'' + data + '\')">'
//         + '<i class="ace-icon fa fa-trash-o bigger-120"></i>'
//         + '</a>'
//         + '</li>'
//         + '</ul>'
//         + '</div>'
//         + '</div>';
//   }
// }]


// + '<button id="btnEdit" type="button" class="btn btn-primary">'
// + '<span></span>基本信息'
// + '</button>'
// + '&emsp;'
// + '<button id="btnEdit" type="button" class="btn btn-primary">'
// + '<span></span>详细信息'
// + '</button>'
// + '&emsp;'
// + '<button id="btnEdit" type="button" class="btn btn-primary">'
// + '<span></span>操作日志'
// + '</button>'
// + '&emsp;&emsp;&emsp;&emsp;'
// + '<button id="btnEdit" type="button" class="btn btn-primary">'
// + '<span></span>图文管理'
// + '</button>'
// + '&emsp;'
// + '<button id="btnEdit" type="button" class="btn btn-primary">'
// + '<span></span>头像上传'
// + '</button>'